[Investigation] Reduce the amount of patching in setuptools.build_meta#5008
Open
abravalheri wants to merge 6 commits intomainfrom
Open
[Investigation] Reduce the amount of patching in setuptools.build_meta#5008abravalheri wants to merge 6 commits intomainfrom
setuptools.build_meta#5008abravalheri wants to merge 6 commits intomainfrom
Conversation
…explicit CLI flags
abravalheri
commented
May 22, 2025
|
|
||
| return SetupRequirementsError | ||
|
|
||
| raise AttributeError(name) |
Contributor
Author
There was a problem hiding this comment.
For some reason SetupRequirementsError has been listed in __all__, so this __getattr__ and deprecation warning are here just to be on the safe side (and be very conservative regarding breaking changes).
Contributor
There was a problem hiding this comment.
Hi, I'm trying to use SetupRequirementsError to add dynamic build requirements because https://setuptools.pypa.io/en/stable/build_meta.html#dynamic-build-dependencies-and-other-build-meta-tweaks does not work in some cases due to setuptools invoking setup.py during get_requires_for_build_wheel.
If this gets removed, what's the recommended alternative?
setuptools.build_metasetuptools.build_meta
setuptools.build_metasetuptools.build_meta
Contributor
Author
|
@jaraco is this direction something that makes sense to investigate? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
This started as an exercise in #4973 (comment)
The idea is to avoid all the patching involved in making
setuptools.build_metacompatible withsetup.py.Currently
no_install_setup_requiresis patching the distribution class that is already patched bysetuptools.monkey. It looks very fragile.(Granted, this PR replaces patching with magic argv flags + a bunch of
if-statements, but that can be slightly better?)Closes
Pull Request Checklist
newsfragments/.(See documentation for details)